Skip to content

fix(history): 润色为空时「复制」回退到原文 + 原文面板独立复制入口 (#751)#752

Merged
jiangmuran merged 1 commit into
Open-Less:betafrom
katanumahotori:fix/history-copy-raw
Jun 27, 2026
Merged

fix(history): 润色为空时「复制」回退到原文 + 原文面板独立复制入口 (#751)#752
jiangmuran merged 1 commit into
Open-Less:betafrom
katanumahotori:fix/history-copy-raw

Conversation

@katanumahotori

@katanumahotori katanumahotori commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

User description

摘要

Fixes #751

当润色结果为空(finalText 为空)时,历史页右上「复制」按钮复制的是空字符串,导致 UI 中可见的识别原文无法取回。本 PR 让原文随时可从 UI 取回。

改动(仅前端,无后端 / IPC 改动)

src/pages/History.tsx

  • onCopyfinalText 去空白后为空时,回退复制 rawTranscript
  • 原文面板新增独立「复制」按钮(仅在 rawTranscript 非空时显示),复制识别原文。
  • 复用现有 common.copy / common.copied,不新增 i18n。

不做什么

测试

  • tsc --noEmit 通过。
  • 在一条 finalText 为空的历史记录上:右上「复制」与原文面板「复制」均能取回识别原文;正常记录行为不变(「复制」仍复制润色结果)。

PR Type

Bug fix


Description

  • Copy button falls back to raw transcript when polished text is empty

  • Added independent copy button on the raw transcript panel


Diagram Walkthrough

flowchart LR
  A["Copy button clicked"] --> B{"finalText blank?"}
  B -- "Yes" --> C["Copy rawTranscript"]
  B -- "No" --> D["Copy finalText"]
  E["Raw panel copy button"] --> F["Always copy rawTranscript"]
Loading

File Walkthrough

Relevant files
Bug fix
History.tsx
Fix empty copy and add raw copy button                                     

openless-all/app/src/pages/History.tsx

  • Modified onCopy to fall back to rawTranscript when finalText is empty
  • Added justCopiedRaw state and onCopyRaw handler
  • Added dedicated copy button in raw transcript panel header
+29/-2   

… + copy button on raw panel

When polishing returns an empty finalText (errorCode stays null), the History
"Copy" button copied an empty string, so the raw transcript that is still
visible in the UI could not be recovered. Re-transcribe does not apply here
(ASR succeeded; polish is what failed).

- onCopy: fall back to rawTranscript when finalText is blank
- raw panel: add a dedicated copy button (shown only when rawTranscript exists)
- reuse existing common.copy / common.copied, no new i18n; frontend-only

Complements Open-Less#653 (polish identical to raw); independent of the in-progress
history re-polish work (Open-Less#666/Open-Less#694). No backend/IPC changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

751 - Partially compliant

Compliant requirements:

  • "复制"按钮在 finalText 为空时回退复制 rawTranscript。
  • 原文面板新增独立"复制"按钮,复制 rawTranscript。

Non-compliant requirements:

(none)

Requires further human verification:

(none)

653 - Partially compliant

Compliant requirements:

(none)

Non-compliant requirements:

  • 未识别润色结果与原文一致的情况。
  • 未提供重新润色入口。
  • 未添加历史记录标识。

Requires further human verification:

(none)

694 - Partially compliant

Compliant requirements:

(none)

Non-compliant requirements:

  • 未实现润色未变化检测。
  • 未实现历史重新润色。

Requires further human verification:

(none)

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

@jiangmuran jiangmuran left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its ok and just ai slop

@jiangmuran jiangmuran merged commit bafddd4 into Open-Less:beta Jun 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[area:ux] 润色为空(finalText 为空)时,历史页「复制」复制到空字符串,识别原文无法从 UI 取回

2 participants